import { type RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/LoginView.vue'),
    meta: { requiresAuth: false, title: "登录系统" }
  },
  {
    path: '/',
    component: () => import('../components/layout/MainLayout.vue'),
    meta: { requiresAuth: true, title: "欢迎使用" },
    children: [
      {
        path: '',
        name: 'Dashboard',
        component: () => import('../views/dashboard/DashboardView.vue')
      },
      {
        path: 'teachers',
        name: 'Teacher',
        component: () => import('../views/teacher/TeacherView.vue'),
        meta: { title: "教师管理" }
      },
      {
        path: 'students',
        name: 'Student',
        component: () => import('../views/student/StudentView.vue'),
        meta: { title: "学生管理" }
      },
      {
        path: 'exams',
        name: 'Exam',
        component: () => import('../views/exam/ExamView.vue'),
        meta: { title: "考试管理" }
      },
      {
        path: 'points',
        name: 'Point',
        component: () => import('../views/point/PointView.vue'),
        meta: { title: "积分记录" }
      },
      {
        path: 'myexams',
        name: 'MyExam',
        component: () => import('../views/exam/MyExamView.vue'),
        meta: { title: "我的考试" }
      },
      {
        path: 'messages',
        name: 'Message',
        component: () => import('../views/message/MessageView.vue'),
        meta: { title: "留言簿" }
      },
      {
        path: 'statistics',
        name: 'Statistic',
        component: () => import('../views/statistic/StatisticView.vue'),
        meta: { title: "数据统计" }
      },
      {
        path: 'profile',
        name: 'Profile',
        component: () => import('../views/profile/ProfileView.vue'),
        meta: { title: "我的信息" }
      }
    ]
  }
];

export default routes;